import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/Login.vue'
import Home from '../components/Home.vue'
import Welcome from '../components/Welcome.vue'
import UserForm from '../components/common/UserForm.vue'
import UserQuery from '../components/common/UserQuery.vue'
import PeopleOwner from '../components/common/PeopleOwner.vue'
import People from '../components/common/People.vue'
import ConnectionForm from '../components/common/ConnectionForm.vue'
import ConnectionQuery from '../components/common/ConnectionQuery.vue'
import ConnectionOwner from '../components/common/ConnectionOwner.vue'
import Connection from '../components/common/Connection.vue'
import Familyinsert from '../components/common/Familyinsert.vue'
import View from '../components/common/View.vue'
import peopleEvent from '../components/PeopleEvent.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    redirect: '/welcome',
    children: [{
      path: '/welcome',
      name: 'Welcome',
      component: Welcome
    },
    {
      path: '/userform',
      name: 'UserForm',
      component: UserForm
    },
    {
      path: '/userquery',
      name: 'UserQuery',
      component: UserQuery
    },
    {
      path: '/peopleowner',
      name: 'PeopleOwner',
      component: PeopleOwner
    },
    {
      path: '/people',
      name: 'People',
      component: People
    },
    {
      path: '/connectionForm',
      name: 'ConnectionForm',
      component: ConnectionForm
    },
    {
      path: '/connectionQuery',
      name: 'ConnectionQuery',
      component: ConnectionQuery
    },
    {
      path: '/connectionOwner',
      name: 'ConnectionOWner',
      component: ConnectionOwner
    },
    {
      path: '/connection',
      name: 'Connection',
      component: Connection
    },
    {
      path: '/familyinsert',
      name: 'Familyinsert',
      component: Familyinsert
    },
       {
      path: '/peopleEvent',
      name: 'peopleEvent',
      component: peopleEvent
    },
    {
      path: '/view',
      name: 'View',
      component: View
    }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
